﻿using Rsd.Dudu;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rsd.Faith.Sys
{
    internal  enum ErrorCodesType
    {
        /// <summary>
        /// 服务{0}不存在。
        /// </summary>
        [System.ComponentModel.Description("服务{0}不存在。")]
        FS0002 = 2,

        /// <summary>
        /// 正在创建其他任务，请稍后重试。
        /// </summary>
        [System.ComponentModel.Description("正在创建其他任务，请稍后重试。")]
        FS0003 = 3,
    }

    public static class ExtendMethod
    {
         
        /// <summary>
        /// 
        /// </summary>
        /// <param name="code"></param>
        /// <param name="args"></param>
        internal static void SubmitError(this ErrorCodesType code, params String[] args)
        { 
            ServicesContainer.GetService<Rsd.Dudu.Exception.IExceptionService>(null).Submit(code ,   Rsd.Dudu.Exception.OperationType.CommitAndError, args);
        }
    }
}
